//---------------------------------------------------------------------
//  This file is part of the Background Motion solution.
// 
//  Copyright (C) Mindscape (TM).  All rights reserved.
//  http://www.mindscape.co.nz
// 
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//---------------------------------------------------------------------

using System.Web.UI;

namespace Mindscape.BackgroundMotion.Website.Controls
{
  /// <summary>
  /// This control renders a cloud of tags for the end user to select from
  /// </summary>
  public partial class TagCloud : UserControl
  {
    private TagCloudData _tagCloudData;

    /// <summary>
    /// The TagCloudData which is to be rendered on the control
    /// </summary>
    public TagCloudData TagCloudData
    {
      get { return _tagCloudData; }
      set
      {
        _tagCloudData = value;

        TagsDataBinder.DataBind(this);
      }
    }

    /// <summary>
    /// Sets a value indicating whether to apply center alignment to the rendering.
    /// </summary>
    /// <value><c>true</c> if [center align]; otherwise, <c>false</c>.</value>
    public bool CenterAlign
    {
      set
      {
        if (value)
        {
          TagCloudPanel.Style.Add("text-align", "center");
        }
      }
    }

    /// <remarks>
    /// Currently a no-op
    /// </remarks>
    public int TagMargin
    {
      set
      {
        ;
      }
    }
  }
}